﻿using EventBus;
using LiteStep.Conversions;
using LiteStep.Currencies;
using LiteStep.Events.Handlers;
using LiteStep.Exchanges;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LiteStep.Events
{
	public class ConversionUpdatedEvent<TFrom, TTo, TOn> : BaseEvent<IConversionUpdatedEventHandler<TFrom, TTo, TOn>>
		where TFrom : ICurrency
		where TTo : ICurrency
		where TOn : IExchange
	{
		public IConversion<TFrom, TTo, TOn> Conversion { get; private set; }

		public ConversionUpdatedEvent(IConversion<TFrom, TTo, TOn> conversion)
		{
			this.Conversion = conversion;
		}

		public override void Dispatch(IConversionUpdatedEventHandler<TFrom, TTo, TOn> handler)
		{
			handler.OnConversionUpdatedEvent(this);
		}
	}
}
